package com.fr.web.platform.core;

import com.fr.base.core.json.JSONArray;
import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import java.util.Iterator;
import java.util.List;

public class TTNode
{
  public static final int NONE = 0;
  public static final int SELECTED = 1;
  public static final int MIDDLE = 2;
  private String id;
  private String path;
  private String text;
  private boolean hasChildren;
  private boolean isExpand;
  private int viewState;
  private int writeState;
  private int designState;
  private int formState;

  public String getId()
  {
    return this.id;
  }

  public void setId(String paramString)
  {
    this.id = paramString;
  }

  public String getPath()
  {
    return this.path;
  }

  public void setPath(String paramString)
  {
    this.path = paramString;
  }

  public String getText()
  {
    return this.text;
  }

  public void setText(String paramString)
  {
    this.text = paramString;
  }

  public boolean hasChildren()
  {
    return this.hasChildren;
  }

  public void setHasChildren(boolean paramBoolean)
  {
    this.hasChildren = paramBoolean;
  }

  public boolean isExpand()
  {
    return this.isExpand;
  }

  public void setExpand(boolean paramBoolean)
  {
    this.isExpand = paramBoolean;
  }

  public int getViewState()
  {
    return this.viewState;
  }

  public void setViewState(int paramInt)
  {
    this.viewState = paramInt;
  }

  public int getWriteState()
  {
    return this.writeState;
  }

  public void setWriteState(int paramInt)
  {
    this.writeState = paramInt;
  }

  public int getDesignState()
  {
    return this.designState;
  }

  public void setDesignState(int paramInt)
  {
    this.designState = paramInt;
  }

  public int getFormState()
  {
    return this.formState;
  }

  public void setFormState(int paramInt)
  {
    this.formState = paramInt;
  }

  public static JSONArray toJSONArray(List paramList)
    throws JSONException
  {
    JSONArray localJSONArray = new JSONArray();
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      TTNode localTTNode = (TTNode)localIterator.next();
      JSONObject localJSONObject = new JSONObject();
      localJSONObject.put("id", localTTNode.id);
      localJSONObject.put("text", localTTNode.text);
      localJSONObject.put("path", localTTNode.path);
      localJSONObject.put("isexpand", localTTNode.isExpand);
      localJSONObject.put("hasChildren", localTTNode.hasChildren);
      localJSONObject.put("view", localTTNode.viewState);
      localJSONObject.put("write", localTTNode.writeState);
      localJSONObject.put("design", localTTNode.designState);
      localJSONObject.put("form", localTTNode.formState);
      localJSONArray.put(localJSONObject);
    }
    return localJSONArray;
  }
}